package com.leiyk.rateLimiter.controller;

import com.leiyk.rateLimiter.annotation.SimpleRateLimiter;
import jakarta.annotation.Resource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 测试controller
 * @Author: leiyk6
 * @Date: 2024/7/2 16:56
 */
@RestController
public class TestController {

    @GetMapping("/test")
    @SimpleRateLimiter(time = 100, maxCount = 1)
    public String test(){
        // Hello! World
        System.out.println("controller");
        return "Hello! World";
    }

}
